#include <buola/graph/cgraph.h>
#include <buola/mat.h>

using namespace buola;

int main()
{
    std::vector<mat::CVec2d> lPoints;
    for(int i=0;i<100;i++)
        lPoints.push_back(mat::random(2));

    for(const auto &p : lPoints)
        msg_info() << p.T();
    
    start_timer();
    auto lGraph=graph::build(lPoints,[](const mat::CVec2d &p1,const mat::CVec2d &p2){return distance(p1,p2)<0.05;});
    end_timer();
    msg_info() << num_edges(lGraph) << "\n";
    
    for(const auto &e : edges(lGraph))
    {
        msg_info() << lGraph[source(e,lGraph)].T() << " --> " << lGraph[target(e,lGraph)].T() << "\n";
    }
}
